package task9;

import java.util.ArrayList;
import java.util.Random;

public class Test1 {
    public static void main(String[] args) {
        Random r = new Random();

        ArrayList<Integer> array = new ArrayList<Integer>();

        int count = 0;

        while (count < 10) {
            int number = r.nextInt(40) + 1;

            if (!array.contains(number)) {
                array.add(number);
                count++;
            }
        }
        for (Integer i : array) {
            System.out.println(i);
        }
    }
}
